﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using School;

namespace TestSchool
{
    [TestClass]
    public class TestStudent
    {
        [TestMethod]
        public void Student_TestNameIsNotNull()
        {
            string name = "Ivo";
            int number = 13245;
            Student student = new Student(name, number);
            Assert.IsNotNull(student.Name, "Student's name can not be null!");
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void Student_TestNameIsNotEmptyString()
        {
            Student student = new Student();
            student.Name = "";
        }

        [TestMethod]
        public void Student_UniqueNumberIsMin10000()
        {
            string name = "Ivo";
            int number = 10000;
            Student student = new Student(name, number);
            Assert.AreEqual(student.UniqueNumber, 10000, "Student's unique number must be at least 10000!");
        }

        [TestMethod]
        public void Student_UniqueNumberIsMax99999()
        {
            string name = "Ivo";
            int number = 99999;
            Student student = new Student(name, number);
            Assert.AreEqual(student.UniqueNumber, 99999, "Student's unique number must be maximum 99999!");
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void Student_TestUniqueNumberIsInRange()
        {
            Student student = new Student();
            student.UniqueNumber = 323;
        }

    }
}
